        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>DebugDraw abstract class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="DebugDraw">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/DebugDraw.html">DebugDraw</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>DebugDraw</strong>
          abstract class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
abstract class DebugDraw {
 // TODO(gregbglw): Draw joints once have them implemented. Also draw other
 // neat stuff described below.

 /// draw shapes
 static const int e_shapeBit = 0x0001;
 /// draw joint connections
 static const int e_jointBit = 0x0002;
 /// draw core (TimeOfImpact) shapes
 static const int e_aabbBit = 0x0004;
 /// draw axis aligned boxes
 static const int e_pairBit = 0x0008;
 /// draw center of mass 
 static const int e_centerOfMassBit = 0x0010;
 /// draw dynamic tree.
 static const int e_dynamicTreeBit = 0x0020;
 /// draw with lines (vs. default filled polygons).
 static const int e_lineDrawingBit = 0x0040;

 int flags;
 ViewportTransform viewportTransform;

 DebugDraw(ViewportTransform viewport)
     : flags = e_shapeBit,
       viewportTransform = viewport;

 void appendFlags(int value) { flags |= value; }
 void clearFlags(int value) { flags &amp;= ~value; }

 /** Draw a closed polygon provided in CCW order. */
 void drawPolygon(List&lt;vec2&gt; vertices, int vertexCount, Color3 color);

 /** Draws the given point with the given radius and color.  */
 void drawPoint(vec2 point, num radiusOnScreen, Color3 color);

 /** Draw a solid closed polygon provided in CCW order. */
 void drawSolidPolygon(List&lt;vec2&gt; vertices, int vertexCount, Color3 color);

 /** Draw a circle. */
 void drawCircle(vec2 center, num radius, Color3 color, [vec2 axis]);

 /** Draw a solid circle. */
 void drawSolidCircle(vec2 center, num radius, Color3 color, [vec2 axis]);

 /** Draw a line segment. */
 void drawSegment(vec2 p1, vec2 p2, Color3 color);

 /** Draw a transform.  Choose your own length scale. */
 void drawTransform(Transform xf, Color3 color);

 /** Draw a string. */
 // TODO(dominich): font.
 void drawString(num x, num y, String s, Color3 color);

 /**
  * Sets the center of the viewport to the given x and y values and the
  * viewport scale to the given scale.
  */
 void setCamera(num x, num y, num scale) {
   viewportTransform.setCamera(x,y,scale);
 }

 /**
  * Screen coordinates are specified in argScreen. These coordinates are
  * converted to World coordinates and placed in the argWorld return vector.
  */
 void getScreenToWorldToOut(vec2 argScreen, vec2 argWorld) {
   viewportTransform.getScreenToWorld(argScreen, argWorld);
 }

 /**
  * World coordinates are specified in argWorld. These coordinates are
  * converted to screen coordinates and placed in the argScreen return vector.
  */
 void getWorldToScreenToOut(vec2 argWorld, vec2 argScreen) {
   viewportTransform.getWorldToScreen(argWorld, argScreen);
 }
}
</pre>
</div>
<h3>Subclasses</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../box2d_browser/CanvasDraw.html">CanvasDraw</a></span></p>
<div>
<h3>Static Properties</h3>
<div class="field"><h4 id="e_aabbBit">
<button class="show-code">Code</button>
const int         <strong>e_aabbBit</strong> <a class="anchor-link"
            href="#e_aabbBit"
            title="Permalink to DebugDraw.e_aabbBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_aabbBit = 0x0004
</pre>
</div>
</div>
<div class="field"><h4 id="e_centerOfMassBit">
<button class="show-code">Code</button>
const int         <strong>e_centerOfMassBit</strong> <a class="anchor-link"
            href="#e_centerOfMassBit"
            title="Permalink to DebugDraw.e_centerOfMassBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_centerOfMassBit = 0x0010
</pre>
</div>
</div>
<div class="field"><h4 id="e_dynamicTreeBit">
<button class="show-code">Code</button>
const int         <strong>e_dynamicTreeBit</strong> <a class="anchor-link"
            href="#e_dynamicTreeBit"
            title="Permalink to DebugDraw.e_dynamicTreeBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_dynamicTreeBit = 0x0020
</pre>
</div>
</div>
<div class="field"><h4 id="e_jointBit">
<button class="show-code">Code</button>
const int         <strong>e_jointBit</strong> <a class="anchor-link"
            href="#e_jointBit"
            title="Permalink to DebugDraw.e_jointBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_jointBit = 0x0002
</pre>
</div>
</div>
<div class="field"><h4 id="e_lineDrawingBit">
<button class="show-code">Code</button>
const int         <strong>e_lineDrawingBit</strong> <a class="anchor-link"
            href="#e_lineDrawingBit"
            title="Permalink to DebugDraw.e_lineDrawingBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_lineDrawingBit = 0x0040
</pre>
</div>
</div>
<div class="field"><h4 id="e_pairBit">
<button class="show-code">Code</button>
const int         <strong>e_pairBit</strong> <a class="anchor-link"
            href="#e_pairBit"
            title="Permalink to DebugDraw.e_pairBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_pairBit = 0x0008
</pre>
</div>
</div>
<div class="field"><h4 id="e_shapeBit">
<button class="show-code">Code</button>
const int         <strong>e_shapeBit</strong> <a class="anchor-link"
            href="#e_shapeBit"
            title="Permalink to DebugDraw.e_shapeBit">#</a>
        </h4>
        <div class="doc">
<pre class="source">
e_shapeBit = 0x0001
</pre>
</div>
</div>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="DebugDraw">
<button class="show-code">Code</button>
new <strong>DebugDraw</strong>(<a href="../box2d/ViewportTransform.html">ViewportTransform</a> viewport) <a class="anchor-link" href="#DebugDraw"
              title="Permalink to DebugDraw.DebugDraw">#</a></h4>
<div class="doc">
<pre class="source">
DebugDraw(ViewportTransform viewport)
   : flags = e_shapeBit,
     viewportTransform = viewport;
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="flags">
<button class="show-code">Code</button>
int         <strong>flags</strong> <a class="anchor-link"
            href="#flags"
            title="Permalink to DebugDraw.flags">#</a>
        </h4>
        <div class="doc">
<pre class="source">
flags
</pre>
</div>
</div>
<div class="field"><h4 id="viewportTransform">
<button class="show-code">Code</button>
<a href="../box2d/ViewportTransform.html">ViewportTransform</a>         <strong>viewportTransform</strong> <a class="anchor-link"
            href="#viewportTransform"
            title="Permalink to DebugDraw.viewportTransform">#</a>
        </h4>
        <div class="doc">
<pre class="source">
viewportTransform
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="appendFlags">
<button class="show-code">Code</button>
void <strong>appendFlags</strong>(int value) <a class="anchor-link" href="#appendFlags"
              title="Permalink to DebugDraw.appendFlags">#</a></h4>
<div class="doc">
<pre class="source">
void appendFlags(int value) { flags |= value; }
</pre>
</div>
</div>
<div class="method"><h4 id="clearFlags">
<button class="show-code">Code</button>
void <strong>clearFlags</strong>(int value) <a class="anchor-link" href="#clearFlags"
              title="Permalink to DebugDraw.clearFlags">#</a></h4>
<div class="doc">
<pre class="source">
void clearFlags(int value) { flags &amp;= ~value; }
</pre>
</div>
</div>
<div class="method"><h4 id="drawCircle">
abstract void <strong>drawCircle</strong>(<a href="../vector_math/vec2.html">vec2</a> center, num radius, <a href="../box2d/Color3.html">Color3</a> color, [<a href="../vector_math/vec2.html">vec2</a> axis]) <a class="anchor-link" href="#drawCircle"
              title="Permalink to DebugDraw.drawCircle">#</a></h4>
<div class="doc">
<p>Draw a circle. </p>
</div>
</div>
<div class="method"><h4 id="drawPoint">
abstract void <strong>drawPoint</strong>(<a href="../vector_math/vec2.html">vec2</a> point, num radiusOnScreen, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawPoint"
              title="Permalink to DebugDraw.drawPoint">#</a></h4>
<div class="doc">
<p>Draws the given point with the given radius and color.  </p>
</div>
</div>
<div class="method"><h4 id="drawPolygon">
abstract void <strong>drawPolygon</strong>(List&lt;<a href="../vector_math/vec2.html">vec2</a>&gt; vertices, int vertexCount, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawPolygon"
              title="Permalink to DebugDraw.drawPolygon">#</a></h4>
<div class="doc">
<p>Draw a closed polygon provided in CCW order. </p>
</div>
</div>
<div class="method"><h4 id="drawSegment">
abstract void <strong>drawSegment</strong>(<a href="../vector_math/vec2.html">vec2</a> p1, <a href="../vector_math/vec2.html">vec2</a> p2, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawSegment"
              title="Permalink to DebugDraw.drawSegment">#</a></h4>
<div class="doc">
<p>Draw a line segment. </p>
</div>
</div>
<div class="method"><h4 id="drawSolidCircle">
abstract void <strong>drawSolidCircle</strong>(<a href="../vector_math/vec2.html">vec2</a> center, num radius, <a href="../box2d/Color3.html">Color3</a> color, [<a href="../vector_math/vec2.html">vec2</a> axis]) <a class="anchor-link" href="#drawSolidCircle"
              title="Permalink to DebugDraw.drawSolidCircle">#</a></h4>
<div class="doc">
<p>Draw a solid circle. </p>
</div>
</div>
<div class="method"><h4 id="drawSolidPolygon">
abstract void <strong>drawSolidPolygon</strong>(List&lt;<a href="../vector_math/vec2.html">vec2</a>&gt; vertices, int vertexCount, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawSolidPolygon"
              title="Permalink to DebugDraw.drawSolidPolygon">#</a></h4>
<div class="doc">
<p>Draw a solid closed polygon provided in CCW order. </p>
</div>
</div>
<div class="method"><h4 id="drawString">
abstract void <strong>drawString</strong>(num x, num y, String s, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawString"
              title="Permalink to DebugDraw.drawString">#</a></h4>
<div class="doc">
<p>Draw a string. </p>
</div>
</div>
<div class="method"><h4 id="drawTransform">
abstract void <strong>drawTransform</strong>(<a href="../box2d/Transform.html">Transform</a> xf, <a href="../box2d/Color3.html">Color3</a> color) <a class="anchor-link" href="#drawTransform"
              title="Permalink to DebugDraw.drawTransform">#</a></h4>
<div class="doc">
<p>Draw a transform.  Choose your own length scale. </p>
</div>
</div>
<div class="method"><h4 id="getScreenToWorldToOut">
<button class="show-code">Code</button>
void <strong>getScreenToWorldToOut</strong>(<a href="../vector_math/vec2.html">vec2</a> argScreen, <a href="../vector_math/vec2.html">vec2</a> argWorld) <a class="anchor-link" href="#getScreenToWorldToOut"
              title="Permalink to DebugDraw.getScreenToWorldToOut">#</a></h4>
<div class="doc">
<p>Screen coordinates are specified in argScreen. These coordinates are
converted to World coordinates and placed in the argWorld return vector.</p>
<pre class="source">
void getScreenToWorldToOut(vec2 argScreen, vec2 argWorld) {
 viewportTransform.getScreenToWorld(argScreen, argWorld);
}
</pre>
</div>
</div>
<div class="method"><h4 id="getWorldToScreenToOut">
<button class="show-code">Code</button>
void <strong>getWorldToScreenToOut</strong>(<a href="../vector_math/vec2.html">vec2</a> argWorld, <a href="../vector_math/vec2.html">vec2</a> argScreen) <a class="anchor-link" href="#getWorldToScreenToOut"
              title="Permalink to DebugDraw.getWorldToScreenToOut">#</a></h4>
<div class="doc">
<p>World coordinates are specified in argWorld. These coordinates are
converted to screen coordinates and placed in the argScreen return vector.</p>
<pre class="source">
void getWorldToScreenToOut(vec2 argWorld, vec2 argScreen) {
 viewportTransform.getWorldToScreen(argWorld, argScreen);
}
</pre>
</div>
</div>
<div class="method"><h4 id="setCamera">
<button class="show-code">Code</button>
void <strong>setCamera</strong>(num x, num y, num scale) <a class="anchor-link" href="#setCamera"
              title="Permalink to DebugDraw.setCamera">#</a></h4>
<div class="doc">
<p>Sets the center of the viewport to the given x and y values and the
viewport scale to the given scale.</p>
<pre class="source">
void setCamera(num x, num y, num scale) {
 viewportTransform.setCamera(x,y,scale);
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
